﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;


namespace TCKQKL.FrontEnd.Web
{
    public partial class Site : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!isLoggedin())
            {
                lnkAuthentication.Text = "Đăng nhập";
                lnkAuthentication.PostBackUrl = "Login.aspx";
            }
            else
            {
                lnkAuthentication.Text = "Thoát";
                lnkAuthentication.PostBackUrl = "Logout.aspx";
            }
        }
        protected bool isLoggedin()
        {
            string userid = HttpContext.Current.User.Identity.Name;
            if (userid == "")
            {
                FormsAuthentication.SignOut();
                return false;
            }
            else
                return true;
        }
    }
}
